-
Notifications
You must be signed in to change notification settings - Fork 475
Created Android scoped storage migration method #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created Android scoped storage migration method #559
Conversation
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
This reverts commit 6fbaf4c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one Evan 👍 I just left few comments to make it bit more explicit that this migration is related to Expo.
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageMigration.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
@tido64 mind having a look as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. Just a couple of questions to educate myself 😄
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java
Show resolved
Hide resolved
🎉 This PR is included in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Expo users who publish an app with
expo build:android
will use a database file likeRKStorage-scoped-experience- <encoded-project-slug>
when they eject, thedatabase file will be
RKStorage
, this effectively prevents many users from being able to eject expo/expo#8220 and use this package.This PR introduces parity for an iOS feature that migrates the database directory.
RKStorage
file exists (if not bail out).RKStorage-scoped-experience-
RKStorage
Test Plan
Testing this feature is a little involved.
Managed -> Bare
RKStorage
file.AsyncStorageMigration.migrate(reactContext);
RKStorage-scoped-experience-foobar-1
RKStorage-scoped-experience-foobar-2
) -- This is to test that the most recent slug gets used.AsyncStorageMigration.migrate(reactContext);
and change the database name back toRKStorage
.RKStorage-scoped-experience-foobar-2
.Bare only
RKStorage
file.AsyncStorage
for the first time without ever using Expo will see.